package com.scu.phototabuser.util;

import android.content.Context;
import android.widget.Toast;

import com.scu.phototabuser.App;

/**
 * Created by tianfei on 2017/4/8.
 */

public class ToastUtil {

    private static Toast toast;

    public static void makeToast(Context context, String text){

        if (toast == null) {
            toast = Toast.makeText(context,
                    text,
                    Toast.LENGTH_SHORT);
        } else {
            toast.setText(text);
        }
        toast.show();
    }

    public static void makeAppContextToast(String text){
        if (toast == null) {
            toast = Toast.makeText(App.context,
                    text,
                    Toast.LENGTH_SHORT);
        } else {
            toast.setText(text);
        }
        toast.show();
    }

}
